<?php
declare (strict_types=1);

namespace app\common\model;

use think\Model;

//登录日志数据表
class AdminLoginLogModel extends Model
{
    protected $table = 'utf8mb4_admin_login_log';

    //添加日志
    public function addLog(int $uid, string $field, string $ip, int $status, string $password = '')
    {
        if (!is_numeric($uid) || !is_numeric($status)) {
            return false;
        }
        $save = [];
        $save['uid'] = $uid;
        $save['field'] = $field;
        $save['ip'] = $ip;
        $save['status'] = $status;
        $save['password'] = $password;
        return $this->save($save);
    }

}